# 统一返回结果类
from flask import jsonify


class Result:

    def __init__(self, status=0, data=None, message='ok'):
        # 状态码
        self.status = status
        # 数据
        self.data = data
        # 消息
        self.message = message



    def __str__(self):
        return f"Result(status={self.status}, data={self.data}, message={self.message})"

    def to_json(self):
        return jsonify(self.__dict__)